package com.itheima.text3;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
import java.util.Scanner;

public class TCPSocket {
    public static void main(String[] args) throws IOException {
        Socket socket = new Socket("192.168.23.64",10003);

        Scanner sc = new Scanner(System.in);

        while (true) {
            String line = sc.nextLine();
            if ("over".equals(line)){
                break;
            }
            OutputStream os = socket.getOutputStream();
            os.write(line.getBytes());
        }
        socket.shutdownOutput();

    }
}
